Conversation
src/core/ActionRegister.h
Outdated
| #include <memory> | ||
|
|
||
| namespace PLMD { | ||
| namespace PLMD { //{ |
There was a problem hiding this comment.
@Iximiel why this additional open brace after the comment?
There was a problem hiding this comment.
I'm not a vim user, but is what I understood to do from this
There was a problem hiding this comment.
That's only for macros. Here the braces are already available, vim can match them.
|
@Iximiel I do not understand the removal of the quotes. Is it to allow multiple names for multiple registrations? Notice that this has two negative effects:
I think using the line number to distinguish the two names (as it is now) is a cleaner solution. |
src/core/ActionRegister.h
Outdated
| //and the next template will be template<ActionType ActionType> | ||
|
|
||
| template<typename ActionClass> | ||
| class plumedRegisterer{ |
There was a problem hiding this comment.
We usually use capital letters for classes (PlumedRegisterer)
There was a problem hiding this comment.
i corrected that in the fourth commit, is that not up?
There was a problem hiding this comment.
Maybe I was reviewing an older commit sorry for this
|
Yes, I wanted to allow multiple names by using the wanted directive as a variable name and use the I suspected that removing the quotes was a too heavy change If you prefer, I'll reverting that and substituting: with |
|
Yes I think it's cleaner thanks!!! |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## c++17 #935 +/- ##
==========================================
- Coverage 85.78% 85.73% -0.05%
==========================================
Files 600 600
Lines 54724 54437 -287
==========================================
- Hits 46945 46673 -272
+ Misses 7779 7764 -15
☔ View full report in Codecov by Sentry. |
|
|
||
| #define PLUMED_CONCATENATE_DIRECT(s1, s2) s1##s2 | ||
| #define PLUMED_CONCATENATE(s1, s2) PLUMED_CONCATENATE_DIRECT(s1, s2) | ||
| #define PLUMED_UNIQUENAME(str) PLUMED_CONCATENATE(str, __LINE__) |
There was a problem hiding this comment.
You eliminated an indirection. I honestly do not remember anymore why it was there. Are you sure this is ok?
There was a problem hiding this comment.
I think it's correct. You are just using PLUMED_CONCATENATE below..
.gitignore
Outdated
| /config.* | ||
| /autom4* | ||
| /stamp-h | ||
| /build |
There was a problem hiding this comment.
maybe this can be a standalone commit?
Description
#define PLUMED_REGISTER_ACTION(classname,directive) ActionRegistration<classname> directive##Registerer(#directive);instead of a whole class definition+declarationfor a in */; do sed -r 's%(PLUMED_REGISTER_ACTION\(.*,.*)\"([A-Z_0-9]*)\"(\))%\1\2\3%g' "$a"/*cpp -i; donethe string constant is automatically stringified by the "#" operator in the preprocessorsedaway to be completely exchanged by the explicit template toolIn the case of multiple definitions, like XDistances and XYTorsion, the compiler will only declare one specialized ActionRegistration, but with multiple differently named instances without errors, for example
Target release
I would like my code to appear in the C++17 release (it uses a
inline constexprvariable).Type of contribution
Copyright
COPYRIGHTfile with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulenamein order to make sure the headers of the module are correct.Tests